package com.kaifamiao.www.demo.Do27;

public class Students{
    private String name;

    private int age;

    //构造方法
    public Students() {

    }
    //成员方法
    //getter/setter
    //获取姓名
    public String getName() {
        return this.name;
    }
    public int getAge(){
        return this.age;
    }
    public void setName(String name){
        if("蔡徐坤".equals(name)){
            System.out.println("你会唱，跳，RAP，篮球吗?");
        }else{
            this.name = name;
        }
    }
    public void setAge(int age){
        if(age < 1 || age >120){
            System.out.println("你不是人吧");
        }else{
            this.age = age;
        }

    }
}
